import axios from 'axios';
import config from '@/../src/config/index';

const defaultWmsUrl = process.env.NODE_ENV === 'development'
    ? config.wmsUrl.dev
    : process.env.VUE_APP_MODE === 'testEnvironment'
        ? config.wmsUrl.dev
        :  process.env.VUE_APP_MODE === 'temporary'
            ? config.wmsUrl.temporary
            :  process.env.VUE_APP_MODE === 'prod'
                ? config.wmsUrl.pro
                : config.wmsUrl.dev;


// 根据字典查询
export function getAllType (dictType, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/dictionary/' + dictType + '/list',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}

// 获取地图数据
export function getMapLocData (query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/wms_storage_loc/getLocDataByWhCode',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取rgv地图数据
export function getAllMapList (wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/map/getAllMapList',
        method: 'post',
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取rgv地图层级
export function getNodeLayerCode (query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/node/getNodeLayerCode',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取rgv点位信息
export function getNodeList(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/node/getNodeData',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取地图小车
export function getAllUseRgv(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/getAllUseRgv',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取rgv有锁点位信息
export function getAllLockNode(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/node/getAllLockNode',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取点击小车弹出框的信息
export function getCarInfo(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/node/getCarInfo',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 根据点位编号获取任务
export function getTaskDataByNodeCode(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/ts_sub_task/getTaskDataByNodeCode',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 初始化 获取所有小车位置信息
export function initializeVehicle(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/initializeVehicle',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 12个功能接口

// 1托盘举升
export function palletUp(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/palletUp',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 2托盘下降
export function palletDown(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/palletDown',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 3故障恢复
export function resetVehicle(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/resetVehicle',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 4同步设备位置
export function resetPosToVehicle(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/resetPosToVehicle',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 5手动校准
export function manualCalibration(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/manualCalibration',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 6换向巷道
export function changeRoadway(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/changeRoadway',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 7换向坡道
export function changeRamp(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/changeRamp',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 8打开充电桩
export function openCharge(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/openCharge',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 9关闭充电桩
export function closeCharge(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/closeCharge',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 10紧急停止
export function emergencyStop(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/emergencyStop',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 11打开蜂鸣器
export function openAlarm(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/openAlarm',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 12关闭蜂鸣器
export function closeAlarm(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/closeAlarm',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 13空载运行
export function emptyLodeRgv(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/emptyLode',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 14去充电
export function chargeRgv(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/chargeRgv',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 15 任务故障恢复
export function resetTask(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/errorRgvHandle',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 同层移库（入库）任务
export function moveStock(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/moveStock',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 同层移库(出库)任务
export function outStock(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/rgv/outStock',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 获取可用小车
export function getNoStatusVehicle(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/inspection/getNoStatusVehicle',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 新增条码巡检
export function saveOrUpdate(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/inspection/saveOrUpdate',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 生成地图文件
export function generateMapFile (query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/node/mapFile',
        method: 'post',
        data: query,
        responseType: 'blob',
        parameter: {
            type: 'WMS'
        }
    });
}

// 编辑点位信息
export function updateNodeInfo(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/node/update',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 查询今日异常
export function errorInfo(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/errorNotifyMsg/page',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 根据点位获取路径
export function getPathByNode(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/path/getPath',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 获取block
export function getBlock(wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/block/getBlock',
        method: 'post',
        parameter: {
            type: 'WMS'
        }
    });
}

// 新增block
export function addBlock(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/block/blockType',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 生成block与path关系
export function setBlockToPath(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/blockDetail/generatePathToBlock',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 查看block明细
export function getCurrentBlockDetail(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/blockDetail/getCurrentBlockDetail',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// wms 模拟上架
export function setStockInInfo(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/plcManualOperation/setStockInInfo',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 88888888888
// 获取所有仓库
export function getAllWareData (wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/wms_ware_house/getAllWareData',
        method: 'post',
        parameter: {
            type: 'WMS'
        }
    });
}
// 今日汇总
// export const selectToadySummary = (data, wmsUrl= defaultWmsUrl) => axios({
//     url: wmsUrl + '/api/wms_stock/selectToadySummary',
//     method: 'post',
//     data,
//     parameter: {
//         type: 'WMS'
//     }
// });
// export const outInBoundStatusV2 = (data, wmsUrl= defaultWmsUrl) => axios({
//     url: wmsUrl + '/api/wms_out_order_hd/outInBoundStatusV2',
//     method: 'post',
//     data,
//     parameter: {
//         type: 'WMS'
//     }
// });

// 导出二进制流
export function exportWareDataList (query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/wms_ware_house/exportWareData',
        method: 'post',
        data: query,
        responseType: 'blob',
        parameter: {
            type: 'WMS'
        }
    });
}

// 仓储日报汇总
export const getDailySumData = (data, wmsUrl= defaultWmsUrl) => axios({
    url: wmsUrl + '/api/wms_stock/storageDailyData',
    method: 'post',
    data,
    parameter: {
        type: 'WMS'
    }
});
// 导出
export const exportStorageDaily = (data, wmsUrl= defaultWmsUrl) => axios({
    url: wmsUrl + '/api/wms_stock/exportStorageDaily',
    method: 'post',
    responseType: 'blob',
    data,
    parameter: {
        type: 'WMS'
    }
});
// 仓储业务日报
export const getStorageDaily = (data, wmsUrl= defaultWmsUrl) => axios({
    url: wmsUrl + '/api/wms_stock/storageDailySearch',
    method: 'post',
    data,
    parameter: {
        type: 'WMS'
    }
});
// 获取所有运营公司
export function getAllCompany (wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/depart/allCompany',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}

// 根据客户类型获取客户信息
export function selectByCustomerType (body, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/wms_customer/selectByCustomerType',
        method: 'post',
        data: body,
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取所有货主
export function getAllOwner (wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/wms_owner/getAllOwner',
        method: 'post',
        parameter: {
            type: 'WMS'
        }
    });
}
export function getOwnerDataList(wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/wms_owner/getOwnerDataList',
        method: 'post',
        parameter: {
            type: 'WMS'
        }
    });
}
// 业务汇总
export function exportDayBusinessSummary(data, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/wms_stock/exportDayBusinessSummary',
        method: 'post',
        responseType: 'blob',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}
// 反馈汇总
export function exportDayFeedback(data, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/wms_stock/exportDayFeedback',
        method: 'post',
        responseType: 'blob',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}
export function getMainTaskType (query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/main_task_type/page ',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

export function getSubTaskType (query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/ts_sub_task_typ/page',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 入库箱号列表
export function inStockBusinessNumList(data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_in_plan/inStockBusinessNumList',
        method: 'post',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}
// 入库箱号列表合计字段
export function inStockBusinessNumListSum(data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_in_plan/inStockBusinessNumListSum',
        method: 'post',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}
// 出库车号列表
export function outStockBusinessNumList(data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_out_plan/outStockBusinessNumList',
        method: 'post',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}
// 出库车号列表合计字段
export function outStockBusinessNumListSum(data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_out_plan/outStockBusinessNumListSum',
        method: 'post',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}
// 入库托盘列表
export function inStockTraceCodeList(data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_in_plan/inStockTraceCodeList',
        method: 'post',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}
// 入库托盘列表合计字段
export function inStockTraceCodeListSum(data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_in_plan/inStockTraceCodeListSum',
        method: 'post',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}
// 出库托盘列表
export function outStockTraceCodeList(data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_out_plan/outStockTraceCodeList',
        method: 'post',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}
// 出库托盘列表合计字段
export function outStockTraceCodeListSum(data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_out_plan/outStockTraceCodeListSum',
        method: 'post',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}

// 监控端
// 获取物料信息
export function getMaterialInfo (query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_stock/selectAllStockInfo/' + query,
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
// 查询
export function getByMatCodeAndTime(query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_stock/getByMatCodeAndTime',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 根据存储区获取巷道关系
export function getDataByStgSecCode(query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_alley_stg_relation/getDataByStgSecCode',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

export function syncData (wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_storage_loc/syncSuruiMapInfo',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
export function syncBerthData (wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_storage_loc/syncSuruiBerthCode',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
export function syncPhysicalArea (query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/ccsMap/syncMapArea',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 根据物理区同步地图
export function syncMapArea (wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/ccsMap/syncMapArea',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}

// 获取楼层
export function getFloorNum(query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_storage_loc/getFloorNum',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取点位信息
export function getBinCodeInfo(query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_stock/getBinCodeInfo/' + query,
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
// 库位转换为通道
export function transformStorageToWay (query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_storage_loc/transformStorageToWay',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 远程配置
export function remoteConfig (wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_alley/updateAllMapInfo',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
// 根据区域移库
export function createMoveStockTask(data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_move_task/createMoveStockTask',
        method: 'post',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}

// 点到点移库
export function createMoveTask(data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_move_tran_task_item/createMoveTask',
        method: 'post',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}
// 存储区配置巷道
export function generateAlleyStgRelation(query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_alley_stg_relation/generateAlleyStgRelation',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取所有存储区
export function getAllStgSecList(query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_stg_sec/getAllStgSecList',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

// 删除存储区获取巷道关系
export function saveStgRelatDataList(query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_alley_stg_relation/saveStgRelatDataList',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
export function lockOrUnLockStorageLoc (data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + 'api/wms_storage_loc/manualLockLoc',
        method: 'post',
        data: data,
        parameter: {
            type: 'WMS'
        }
    });
}
export function manualMergeAlley (data, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + 'api/algorithm/manualMergeAlley',
        method: 'post',
        data: data,
        parameter: {
            type: 'WMS'
        }
    });
}
export function selectEquipLocation (wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/iwcs/services/rest/rpcService/selectEquipLocation',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
// 合并巷道
export function mergeAlleyParam(query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/algorithm/mergeAlleyParam',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 选中呼叫功能
export function inRecall(query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/iwcs/services/rest/rpcService/frontInRecal',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 合并巷道
export function reckonMergeAlleyResult(query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/algorithm/reckonMergeAlleyResult',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取所有物理区
export function getAllPhysical (wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/ccsMap/getAllPhysical',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取所有库区
export function getAllStgData(wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_stg_typ/getAllStgData',
        method: 'post',
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取仓间
export function getAllStore (wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_alley_group/getAllStore',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取逻辑库区
export function getAllRoom (wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/wms_alley_group/getAllRoom',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
// 获取出库所有可用月台
export function getOutStockplatform (query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/iwms/services/rest/rpcService/containerWms/getAllAvailableDock',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

//   新仓储统计
// 获取消息
export function selectByUserNameAndStatus(body, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/notice_user/selectByUserNameAndStatus',
        method: 'post',
        data: body,
        parameter: {
            type: 'WMS'
        }
    });
}

// 修改单个类型的数据
export function updateDictByDictType (query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/dictionary/updateDictByDictType',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 查询库位分布详情
export const selectLocationDistributionDetails = (data, wmsUrl= defaultWmsUrl) => axios.request({
    url: wmsUrl + '/api/wms_stock/selectLocationDistributionDetails',
    method: 'post',
    data,
    parameter: {
        type: 'WMS'
    }
});
// 审批方案详情
export function getProjecctDetailById (id, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/approve_project_detail/ProjectDetail/' + id,
        method: 'post',
        parameter: {
            type: 'WMS'
        }
    });
}

export function getApproveSettingList (query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/approve_project/page',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
// 删除审批方案

export function deleteProjectByIds (query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/approve_project/deleteProjectByIds',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}

export function transferCreated (query, wmsUrl= defaultWmsUrl) {
    return axios.request({
        url: wmsUrl + '/api/approve_project/transfer',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
export function stockPageList (query, wmsUrl= defaultWmsUrl, cancelToken) {
    return axios({
        url: wmsUrl + '/api/wms_stock/pageCcisList',
        // url: wmsUrl + '/api/wms_stock/pageList',
        method: 'post',
        data: query,
        cancelToken,
        parameter: {
            type: 'WMS'
        }
    });
}
export function businessItemPageList (query, wmsUrl= defaultWmsUrl, cancelToken) {
    return axios({
        url: wmsUrl + '/api/wms_stock/businessItemPageList',
        // url: wmsUrl + '/api/wms_stock/pageList',
        method: 'post',
        data: query,
        cancelToken,
        parameter: {
            type: 'WMS'
        }
    });
}
export function queryStock(query) {
    return axios.request({
        url: '/api/fm_stock_message/queryStock',
        method: 'post',
        data: query
    });
}

export function getSumData(query) {
  return axios.request({
    url: '/api/fm_stock_message/queryStock',
    method: 'post',
    data: query
  });
}

export function queryStockList(query) {
    return axios.request({
        url: '/api/fm_stock_message/queryStockList',
        method: 'post',
        data: query
    });
}
export function getCurrentCompanyUsers(wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/sUser/currentCompany/users/all',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
export function getAllWareList() {
    return axios({
        url: '/api/platform_warehouse/getAllWareList',
        method: 'post',
        parameter: {
            type: 'WMS'
        }
    });
}
export function queryWarehouseStock(query) {
    return axios({
        url: '/api/fm_stock_message/queryWarehouseStock',
        method: 'post',
        data: query
    });
}
export function matTypeQuery(wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/dictionary/MAT_TYPE/list',
        method: 'get',
        parameter: {
            type: 'WMS'
        }
    });
}
export function exportSummaryExcel(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/wms_stock/exportCcisSummaryExcel',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        },
        responseType: 'blob'
    });
}
export function selectCustomerInfoByDto(query, wmsUrl= defaultWmsUrl) {
    return axios({
        url: wmsUrl + '/api/crm_customer_info/selectCustomerInfoByDto',
        method: 'post',
        data: query,
        parameter: {
            type: 'WMS'
        }
    });
}
export function pushCcisStockInfo(query) {
    return axios({
        url: '/api/fm_stock_message/pushCcisStockInfo',
        method: 'post',
        data: query
    });
}

export function getAllWareDataList(data) {
    return axios({
        url: '/api/platform_warehouse/getAllWareDataList',
        method: 'post',
        data
    });
}

export function selectToadySummary(data) {
    return axios({
        url: '/api/platform_warehouse/selectToadySummary',
        method: 'post',
        data
    });
}
export function outInBoundStatusV2(data) {
    return axios({
        url: '/api/platform_warehouse/outInBoundStatusV2',
        method: 'post',
        data
    });
}
export function outInBoundStatusV2Toc(data) {
    return axios({
        url: '/api/platform_warehouse/outInBoundStatusV2ToC',
        method: 'post',
        data
    });
}
export function getCcisPlanTotal(data) {
    return axios({
        url: '/api/platform_warehouse/getCcisPlanTotal',
        method: 'post',
        data
    });
}
export function exportAllDataList(data, wmsUrl = config.wmsUrl) {
    return axios({
        url: wmsUrl + '/api/wms_stock/exportAllDataList',
        method: 'post',
        responseType: 'blob',
        data,
        parameter: {
            type: 'WMS'
        }
    });
}

export function clientgetPushByUser(body) {
    return axios({
        url: '/api/pushUserMiddle/clientgetPushByUser',
        method: 'post',
        data: body
    })
}

export function platformPageMessage(body) {
    return axios({
        url: '/api/pushUserMiddle/clientPageMessage',
        method: 'post',
        data: body
    })
}
export function doneMessage(body) {
    return axios({
        url: '/api/pushUserMiddle/clientDoneMessage',
        method: 'post',
        data: body
    })
}

// 清空消息
export function clearAllMessage() {
    return axios({
        url: '/api/pushUserMiddle/clearAllMessage',
        method: 'post'
    });
}
